namespace :db do
  desc "Loads a schema.rb file into the database and then loads the initial database fixtures."
  task :bootstrap_aggregator_dbs => ['db:bootstrap_aggregator_dbs:load']
  
  namespace :bootstrap_aggregator_dbs do
    desc "Load aggregator databases to provide recommendations for. "
    task :load => :environment do
      require 'active_record/fixtures'
      ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym)

      # import the bootstrap db entries
      Fixtures.new(AggregatorDb.connection,"aggregator_dbs",AggregatorDb,File.join(RAILS_ROOT, 'db', 'bootstrap',"aggregator_dbs")).insert_fixtures
    end
  end
end

